package com.zxy.ziems.server.storage.controller;

import com.zxy.btp.common.response.JsonResponse;
import com.zxy.ziems.server.storage.pojo.MeasureDataAddDTO;
import com.zxy.ziems.server.storage.service.MeasureDataStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.rmi.ServerException;

/**
 * 数据管理
 */
@RestController
@RequestMapping("/api/measure/data")
public class MeasureDataController {

    @Autowired
    private MeasureDataStorageService measureDataStorageService;

    /**
     * 录入数据
     */
    @PostMapping("/add")
    public JsonResponse<Void> add(@RequestBody @Validated MeasureDataAddDTO bean) throws ServerException {
        measureDataStorageService.storageMeasureData(bean);
        return JsonResponse.SUCCESS();
    }


//    /**
//     * 录入数据
//     */
//    @PostMapping("/update")
//    public JsonResponse<Void> update(@RequestBody @Validated MeasureDataAddDTO bean) throws ServerException {
//        measureDataStorageService.storageMeasureDataUpdate(bean);
//        return JsonResponse.SUCCESS();
//    }


}

